import axios from 'axios'
export function callAjax(param) {
	let method = param.method || 'post'
	axios({
		method : param.method || 'post',
		url : param.url || '',
		data:param.data
	}).then(function(response){
		if(response.staus === 0){
			typeof param.success === 'function' && param.success(response.data,response.msg)
		}else if(response.status === 10){
			typeof param.success === 'function' && param.success(response.data,response.msg)
		}else {
			typeof param.success === 'function' && param.success(response.data,response.msg)
		}
		
	}).catch(function(error){
		typeof param.error === 'function' && param.error(error.statusText)
	})
}